<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<style>
    .title {
        background-color: aqua;
    }
</style>

<body>
    <div id="test1"></div>
    <div id="test2"></div>
    <div id="test3"></div>
</body>
<!-- 核心 -->
<script type="text/javascript" src="./js/react.development.js"></script>

<!-- 虚拟DOM -->
<script type="text/javascript" src="./js/react-dom.development.js"></script>

<!-- 用于将jsx转化为js -->
<script type="text/javascript" src="./js/babel.min.js"></script>

<!-- 引入prop-types. 用于对组件标签属性进行限制 -->

<script type="text/babel">
    // 创建组件
    class Person extends React.Component{
        render(){
            console.log(this);
            return (
                <ul>
                <li>姓名：{this.props.name}</li>
                <li>性别：{this.props.sex}</li>
                <li>年龄：{this.props.age}</li>    
                </ul>
            )
        }
    }
    // 渲染组件到页面
    ReactDOM.render(<Person name="tom" age="18" sex="女"/>,document.getElementById('test1'))
    ReactDOM.render(<Person name="tom" age="18" sex="女"/>,document.getElementById('test2'))
    ReactDOM.render(<Person name="tom" age="18" sex="女"/>,document.getElementById('test3'))

</script>

</html>